<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/5/19
  Time: 12:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<% String path = request.getContextPath();%>
<jsp:include page="/manage/inc/header"/>
<jsp:include page="/manage/inc/menu"/>
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="<%=path%>/manage/index.jsp">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="/jscss/admin/design/">菜单管理</a><span class="crumb-step">&gt;</span><span>新增菜单</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
                <form action="/manage/menu/addWebMenu" method="post" id="myform" name="myform">
                    <table class="insert-tab" width="100%">
                        <tbody>
                        <tr>
                            <th><i class="require-red">*</i>菜单名：</th>
                            <td>
                                <input class="common-text required" id="title" name="title" size="50" value="" type="text">
                            </td>
                        </tr>
                        <tr>
                            <th><i class="require-red">*</i>url：</th>
                            <td><input class="common-text" name="url"  id="url" size="50"  type="text"></td>
                        </tr><tr>
                            <th><i class="require-red">*</i>排名：</th>
                            <td><input class="common-text" name="sort" id="sort" size="50"  type="text"></td>
                        </tr>

                        <tr>
                            <th></th>
                            <td>
                                <input class="btn btn-primary btn6 mr10" value="提交"  id="addBut" type="submit">
                                <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                            </td>
                        </tr>
                        </tbody></table>
                </form>
            </div>
        </div>

    </div>
    <!--/main-->
</div>
<jsp:include page="/manage/inc/footer"/>
    <script>
     $(function() {

         $("#addBut").click(function() {
             var title=$("#title").val();
             if (title==""||title>15){
                 alert("不能为空，也不能超过15")
                return false;
    }
             var url=$("#url").val();
             if(url==""){
                 alert("路径不能为空")
                return  false;
    }
             var sort=$("#sort").val();
             var reg= /^\d+$|^\d+[.]?\d+$/;
             var flag=reg.test(sort);
         if(flag){
             return true;

    }
         else {
             alert("只能输入正整数")
               return  false;

    }




             $("#myform").submit();

    })


    })

    </script>
